<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <title>{$region['title']}</title>
    <link rel="stylesheet" href="{MODULE_URL}template/mobile/style/style1/static/css/weui.css" />
    <link rel="stylesheet" type="text/css" href="{MODULE_URL}template/mobile/style/style1/static/css/region.css" />
    <script type="text/javascript" src="{MODULE_URL}template/mobile/style/style1/static/js/zepto.js"></script>
    <script type="text/javascript" src="{MODULE_URL}template/mobile/style/style1/static/js/zepto.fix.js"></script>
    
</head>

<body>
    <header id="header">
        <div class="header_div">
            <div id="left_div" onClick="javascript:history.back();"></div>
            <div id="middle_div">
                <h1 id="title">我要评价</h1></div>
            <div id="right_div">
                <div class="right_bottom"></div>
                <div class="right_img"></div>
            </div>
        </div>
    </header>
    <div class="cont">
        <div class="weui_cells weui_cells_form">
            <div class="weui_cell weui_cell_select">
                <div class="weui_cell_bd weui_cell_primary">
                    <select class="weui_select" name="rank" id="rank">
                        <option value="0" >请选择满意度</option>
                        <option value="1" >满意</option>
                        <option value="2" >一般</option>
                        <option value="3" >不满意</option>
                    </select>
                </div>
            </div>
            <div class="weui_cell">
                <div class="weui_cell_bd weui_cell_primary">
                    <textarea class="weui_textarea" placeholder="长度5-200个字之间.写下评论内容,有助于我们的工作人员快速帮你解决问题." rows="3" name="comment" id="comment"></textarea>
                    <div class="weui_textarea_counter"><span>0</span>/200</div>
                </div>
            </div>
        </div>
        <div class="bd spacing" style="text-align:center;margin-top:10px;">
            <a href="javascript:;" class="weui_btn weui_btn_primary" id="showToast" style="width:80%">提交信息</a>
        </div>
        <div id="toast" style="display: none;">
            <div class="weui_mask_transparent"></div>
            <div class="weui_toast">
                <i class="weui_icon_toast"></i>
                <p class="weui_toast_content">成功提交</p>
            </div>
        </div>
    </div>
    {template 'style/style1/footer'}
    
    <script>
    $(function() {
        $("#btn_div").fix({
            right: 0,
            bottom: 120
        })
        $("#btn_dj").click(function() {
            var input_btn = $("#btn_input")
            if (input_btn.attr("class") == "btn_img hide_b") {
                input_btn.removeClass();
                input_btn.addClass("btn_img show_b");
            } else {
                input_btn.removeClass();
                input_btn.addClass("btn_img hide_b");
            }
            var menu_b = $("#menu_b")
            if (menu_b.attr("class") == "menu_btn hide_m") {
                menu_b.removeClass();
                menu_b.addClass("menu_btn show_m");
            } else {
                menu_b.removeClass();
                menu_b.addClass("menu_btn hide_m");
            }
        })
    })
    </script>
    <script type="text/javascript">
    $(function() {
        $("#showToast").click(function(event) {
            var comment = $("#comment").val();
            if (comment == '') {
                alert('评论不能为空！');
                return false
            };
            if (comment.length <= 5 || comment.length >= 200) {
                alert('评论必须大于5个小于200个字');
                return false
            };
            var id="{$_GPC['id']}";
            var rank = $("#rank").val();
            $.ajax({
                url: "{php echo $this->createMobileUrl('repair',array('op' => 'rank'))}",
                dataType: 'json',
                data: {
                    rank: rank,
                    comment: comment,
                    id:id
                },
                success: function(s) {
                    if (s.status == 1) {
                        $('#toast').show();
                        setTimeout(function() {
                            $('#toast').hide();
                              window.location.href="{php echo $this->createMobileUrl('repair',array('op' => 'list'))}"; 
                        }, 3000);
                    };
                }
            })


        });
    })
    </script>

    <script>
    $(function() {
        select('a1');
    });
    </script>
</body>

</html>
